]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
pointerA11yTimeout: Set the cursor through ClutterActor API
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 5 Nov 2025 11:41:02 +0000 (12:41 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 19 Jan 2026 09:33:30 +0000 (09:33 +0000)
Set the cursor on the stage. This differs with the "root" cursor
approach in that actors with a non-inherited cursor (e.g. I-beam on
text actors) will stick to that instead of showing the cursor as
set here.

If that's turns out not to be enough, might make sense to move this
piece of a11y feedback to Mutter.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3952>

js/ui/pointerA11yTimeout.js

index b96b4ec1a602f6e9f0aa48ca45fff7839baa4157..8e77719b93389704f0bdf502a7e916f7a72dbe85 100644 (file)
@@ -1,6 +1,5 @@
 import Clutter from 'gi://Clutter';
 import GObject from 'gi://GObject';
-import Meta from 'gi://Meta';
 import St from 'gi://St';
 import * as Main from './main.js';
 import Cairo from 'gi://cairo';
@@ -123,7 +122,7 @@ export class PointerA11yTimeout {
             this._pieTimer.start(x, y, timeout);
 
             if (type === Clutter.PointerA11yTimeoutType.GESTURE)
-                global.display.set_cursor(Meta.Cursor.CROSSHAIR);
+                global.stage.set_cursor_type(Clutter.CursorType.CROSSHAIR);
         });
 
         seat.connect('ptr-a11y-timeout-stopped', (o, type, clicked) => {
@@ -131,7 +130,7 @@ export class PointerA11yTimeout {
                 this._pieTimer?.destroy();
 
             if (type === Clutter.PointerA11yTimeoutType.GESTURE)
-                global.display.set_cursor(Meta.Cursor.DEFAULT);
+                global.stage.set_cursor_type(Clutter.CursorType.DEFAULT);
         });
     }
 }